<form name="user_delete_form" action="{{ path('user_delete') }}" method="post"></form>
<script type="text/javascript">
function confirmUserDelete(){
    var response = confirm("{% trans %}warning{% endtrans %} {% trans %}you can not undo this action are you sure you want to continue{% endtrans %}?");
    //check if the user pressed ok
    if (response == true){
        //delete the account
        document.user_delete_form.submit();
    }
}
</script>
{% trans %}Are you sure you want to{% endtrans %} {% trans %}delete your account{% endtrans %} ?<br><br>
<a href="javascript:confirmUserDelete()">{% trans %}Yes{% endtrans %}</a><br><br>
<a href="{{ path('user_edit') }}">{% trans %}No{% endtrans %}</a><br><br>
<noscript>{% trans %}You have to enable javascript in order to use this feature{% endtrans %}</noscript>